<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: Spec::DSL::Behaviour</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">Spec::DSL::Behaviour</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../../files/vendor/plugins/rspec/lib/spec/dsl/behaviour_rb.html">
                vendor/plugins/rspec/lib/spec/dsl/behaviour.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                <a href="../../Object.html">
                Object
               </a>
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">



   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000308">add_shared_behaviour</a>&nbsp;&nbsp;
      <a href="#M000312">before_eval</a>&nbsp;&nbsp;
      <a href="#M000328">described_type</a>&nbsp;&nbsp;
      <a href="#M000327">description</a>&nbsp;&nbsp;
      <a href="#M000323">execution_context</a>&nbsp;&nbsp;
      <a href="#M000309">find_shared_behaviour</a>&nbsp;&nbsp;
      <a href="#M000319">include</a>&nbsp;&nbsp;
      <a href="#M000315">matches?</a>&nbsp;&nbsp;
      <a href="#M000320">method_missing</a>&nbsp;&nbsp;
      <a href="#M000318">methods</a>&nbsp;&nbsp;
      <a href="#M000311">new</a>&nbsp;&nbsp;
      <a href="#M000314">number_of_examples</a>&nbsp;&nbsp;
      <a href="#M000326">plugin_mock_framework</a>&nbsp;&nbsp;
      <a href="#M000321">prepare_execution_context_class</a>&nbsp;&nbsp;
      <a href="#M000317">retain_examples_matching!</a>&nbsp;&nbsp;
      <a href="#M000313">run</a>&nbsp;&nbsp;
      <a href="#M000325">run_after_all</a>&nbsp;&nbsp;
      <a href="#M000324">run_before_all</a>&nbsp;&nbsp;
      <a href="#M000316">shared?</a>&nbsp;&nbsp;
      <a href="#M000310">shared_behaviours</a>&nbsp;&nbsp;
      <a href="#M000322">weave_in_included_modules</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->
    <div id="includes">
      <h3 class="section-bar">Included Modules</h3>

      <div id="includes-list">
        <span class="include-name"><a href="BehaviourEval/InstanceMethods.html">BehaviourEval::InstanceMethods</a></span>
        <span class="include-name">Spec::Plugins::MockFramework</span>
      </div>
    </div>

    <div id="section">





      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M000308" class="method-detail">
        <a name="M000308"></a>

        <div class="method-heading">
          <a href="#M000308" class="method-signature">
          <span class="method-name">add_shared_behaviour</span><span class="method-args">(behaviour)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000308-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000308-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/dsl/behaviour.rb, line 8</span>
 8:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_shared_behaviour</span>(<span class="ruby-identifier">behaviour</span>)
 9:           <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">behaviour</span>.<span class="ruby-identifier">equal?</span>(<span class="ruby-identifier">found_behaviour</span> = <span class="ruby-identifier">find_shared_behaviour</span>(<span class="ruby-identifier">behaviour</span>.<span class="ruby-identifier">description</span>))
10:           <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">found_behaviour</span> <span class="ruby-keyword kw">and</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">behaviour</span>.<span class="ruby-identifier">description</span>[<span class="ruby-identifier">:spec_path</span>]) <span class="ruby-operator">==</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">found_behaviour</span>.<span class="ruby-identifier">description</span>[<span class="ruby-identifier">:spec_path</span>])
11:           <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">&quot;Shared Behaviour '#{behaviour.description}' already exists&quot;</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">found_behaviour</span>
12:           <span class="ruby-identifier">shared_behaviours</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">behaviour</span>
13:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000309" class="method-detail">
        <a name="M000309"></a>

        <div class="method-heading">
          <a href="#M000309" class="method-signature">
          <span class="method-name">find_shared_behaviour</span><span class="method-args">(behaviour_description)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000309-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000309-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/dsl/behaviour.rb, line 15</span>
15:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">find_shared_behaviour</span>(<span class="ruby-identifier">behaviour_description</span>)
16:           <span class="ruby-identifier">shared_behaviours</span>.<span class="ruby-identifier">find</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span> <span class="ruby-identifier">b</span>.<span class="ruby-identifier">description</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">behaviour_description</span> }
17:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000311" class="method-detail">
        <a name="M000311"></a>

        <div class="method-heading">
          <a href="#M000311" class="method-signature">
          <span class="method-name">new</span><span class="method-args">(*args, &amp;behaviour_block)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000311-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000311-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/dsl/behaviour.rb, line 27</span>
27:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">behaviour_block</span>)
28:         <span class="ruby-identifier">init_description</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
29:         <span class="ruby-identifier">init_eval_module</span>
30:         <span class="ruby-identifier">before_eval</span>
31:         <span class="ruby-identifier">eval_behaviour</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">behaviour_block</span>)
32:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000310" class="method-detail">
        <a name="M000310"></a>

        <div class="method-heading">
          <a href="#M000310" class="method-signature">
          <span class="method-name">shared_behaviours</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000310-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000310-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/dsl/behaviour.rb, line 19</span>
19:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">shared_behaviours</span>
20:           <span class="ruby-comment cmt"># TODO - this needs to be global, or at least accessible from</span>
21:           <span class="ruby-comment cmt"># from subclasses of Behaviour in a centralized place. I'm not loving</span>
22:           <span class="ruby-comment cmt"># this as a solution, but it works for now.</span>
23:           <span class="ruby-identifier">$shared_behaviours</span> <span class="ruby-operator">||=</span> []
24:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000319" class="method-detail">
        <a name="M000319"></a>

        <div class="method-heading">
          <a href="#M000319" class="method-signature">
          <span class="method-name">include</span><span class="method-args">(*args)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Includes modules in the <a href="Behaviour.html">Behaviour</a> (the
<tt>describe</tt> block).
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000319-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000319-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/dsl/behaviour.rb, line 121</span>
121:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">include</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
122:         <span class="ruby-ivar">@eval_module</span>.<span class="ruby-identifier">include</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
123:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000315" class="method-detail">
        <a name="M000315"></a>

        <div class="method-heading">
          <a href="#M000315" class="method-signature">
          <span class="method-name">matches?</span><span class="method-args">(specified_examples)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000315-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000315-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/dsl/behaviour.rb, line 93</span>
 93:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">matches?</span>(<span class="ruby-identifier">specified_examples</span>)
 94:         <span class="ruby-identifier">matcher</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">ExampleMatcher</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">description</span>)
 95: 
 96:         <span class="ruby-identifier">examples</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">example</span><span class="ruby-operator">|</span>
 97:           <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">example</span>.<span class="ruby-identifier">matches?</span>(<span class="ruby-identifier">matcher</span>, <span class="ruby-identifier">specified_examples</span>)
 98:         <span class="ruby-keyword kw">end</span>
 99:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
100:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000318" class="method-detail">
        <a name="M000318"></a>

        <div class="method-heading">
          <a href="#M000318" class="method-signature">
          <span class="method-name">methods</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000318-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000318-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/dsl/behaviour.rb, line 114</span>
114:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">methods</span>
115:         <span class="ruby-identifier">my_methods</span> = <span class="ruby-keyword kw">super</span>
116:         <span class="ruby-identifier">my_methods</span> <span class="ruby-operator">|=</span> <span class="ruby-ivar">@eval_module</span>.<span class="ruby-identifier">methods</span>
117:         <span class="ruby-identifier">my_methods</span>
118:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000314" class="method-detail">
        <a name="M000314"></a>

        <div class="method-heading">
          <a href="#M000314" class="method-signature">
          <span class="method-name">number_of_examples</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000314-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000314-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/dsl/behaviour.rb, line 89</span>
89:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">number_of_examples</span>
90:         <span class="ruby-identifier">examples</span>.<span class="ruby-identifier">length</span>
91:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000317" class="method-detail">
        <a name="M000317"></a>

        <div class="method-heading">
          <a href="#M000317" class="method-signature">
          <span class="method-name">retain_examples_matching!</span><span class="method-args">(specified_examples)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000317-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000317-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/dsl/behaviour.rb, line 106</span>
106:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">retain_examples_matching!</span>(<span class="ruby-identifier">specified_examples</span>)
107:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">specified_examples</span>.<span class="ruby-identifier">index</span>(<span class="ruby-identifier">description</span>)
108:         <span class="ruby-identifier">matcher</span> = <span class="ruby-constant">ExampleMatcher</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">description</span>)
109:         <span class="ruby-identifier">examples</span>.<span class="ruby-identifier">reject!</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">example</span><span class="ruby-operator">|</span>
110:           <span class="ruby-operator">!</span><span class="ruby-identifier">example</span>.<span class="ruby-identifier">matches?</span>(<span class="ruby-identifier">matcher</span>, <span class="ruby-identifier">specified_examples</span>)
111:         <span class="ruby-keyword kw">end</span>
112:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000313" class="method-detail">
        <a name="M000313"></a>

        <div class="method-heading">
          <a href="#M000313" class="method-signature">
          <span class="method-name">run</span><span class="method-args">(reporter, dry_run=false, reverse=false, timeout=nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000313-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000313-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/dsl/behaviour.rb, line 64</span>
64:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run</span>(<span class="ruby-identifier">reporter</span>, <span class="ruby-identifier">dry_run</span>=<span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">reverse</span>=<span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">timeout</span>=<span class="ruby-keyword kw">nil</span>)
65:         <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;shared behaviours should never run&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">shared?</span>
66:         <span class="ruby-comment cmt"># TODO - change add_behaviour to add_description ??????</span>
67:         <span class="ruby-identifier">reporter</span>.<span class="ruby-identifier">add_behaviour</span>(<span class="ruby-ivar">@description</span>)
68:         <span class="ruby-identifier">prepare_execution_context_class</span>
69:         <span class="ruby-identifier">before_all_errors</span> = <span class="ruby-identifier">run_before_all</span>(<span class="ruby-identifier">reporter</span>, <span class="ruby-identifier">dry_run</span>)
70: 
71:         <span class="ruby-identifier">exs</span> = <span class="ruby-identifier">reverse</span> <span class="ruby-value">? </span><span class="ruby-identifier">examples</span>.<span class="ruby-identifier">reverse</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">examples</span>
72:         <span class="ruby-identifier">example_execution_context</span> = <span class="ruby-keyword kw">nil</span>
73:          
74:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">before_all_errors</span>.<span class="ruby-identifier">empty?</span>
75:           <span class="ruby-identifier">exs</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">example</span><span class="ruby-operator">|</span>
76:             <span class="ruby-identifier">example_execution_context</span> = <span class="ruby-identifier">execution_context</span>(<span class="ruby-identifier">example</span>)
77:             <span class="ruby-identifier">example_execution_context</span>.<span class="ruby-identifier">copy_instance_variables_from</span>(<span class="ruby-ivar">@before_and_after_all_context_instance</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">before_all_proc</span>(<span class="ruby-identifier">behaviour_type</span>).<span class="ruby-identifier">nil?</span>
78:             
79:             <span class="ruby-identifier">befores</span> = <span class="ruby-identifier">before_each_proc</span>(<span class="ruby-identifier">behaviour_type</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">raise</span> <span class="ruby-identifier">e</span>}
80:             <span class="ruby-identifier">afters</span> = <span class="ruby-identifier">after_each_proc</span>(<span class="ruby-identifier">behaviour_type</span>)
81:             <span class="ruby-identifier">example</span>.<span class="ruby-identifier">run</span>(<span class="ruby-identifier">reporter</span>, <span class="ruby-identifier">befores</span>, <span class="ruby-identifier">afters</span>, <span class="ruby-identifier">dry_run</span>, <span class="ruby-identifier">example_execution_context</span>, <span class="ruby-identifier">timeout</span>)
82:           <span class="ruby-keyword kw">end</span>
83:         <span class="ruby-keyword kw">end</span>
84:         
85:         <span class="ruby-ivar">@before_and_after_all_context_instance</span>.<span class="ruby-identifier">copy_instance_variables_from</span>(<span class="ruby-identifier">example_execution_context</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">after_all_proc</span>(<span class="ruby-identifier">behaviour_type</span>).<span class="ruby-identifier">nil?</span>
86:         <span class="ruby-identifier">run_after_all</span>(<span class="ruby-identifier">reporter</span>, <span class="ruby-identifier">dry_run</span>)
87:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000316" class="method-detail">
        <a name="M000316"></a>

        <div class="method-heading">
          <a href="#M000316" class="method-signature">
          <span class="method-name">shared?</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000316-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000316-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/dsl/behaviour.rb, line 102</span>
102:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">shared?</span>
103:         <span class="ruby-ivar">@description</span>[<span class="ruby-identifier">:shared</span>]
104:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Protected Instance methods</h3>

      <div id="method-M000312" class="method-detail">
        <a name="M000312"></a>

        <div class="method-heading">
          <a href="#M000312" class="method-signature">
          <span class="method-name">before_eval</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000312-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000312-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/dsl/behaviour.rb, line 59</span>
59:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">before_eval</span>
60:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000328" class="method-detail">
        <a name="M000328"></a>

        <div class="method-heading">
          <a href="#M000328" class="method-signature">
          <span class="method-name">described_type</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000328-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000328-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/dsl/behaviour.rb, line 214</span>
214:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">described_type</span>
215:         <span class="ruby-ivar">@description</span>.<span class="ruby-identifier">described_type</span>
216:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000327" class="method-detail">
        <a name="M000327"></a>

        <div class="method-heading">
          <a href="#M000327" class="method-signature">
          <span class="method-name">description</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000327-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000327-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/dsl/behaviour.rb, line 210</span>
210:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">description</span>
211:         <span class="ruby-ivar">@description</span>.<span class="ruby-identifier">to_s</span>
212:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000323" class="method-detail">
        <a name="M000323"></a>

        <div class="method-heading">
          <a href="#M000323" class="method-signature">
          <span class="method-name">execution_context</span><span class="method-args">(example)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000323-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000323-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/dsl/behaviour.rb, line 167</span>
167:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">execution_context</span>(<span class="ruby-identifier">example</span>)
168:         <span class="ruby-identifier">execution_context_class</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">example</span>)
169:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000320" class="method-detail">
        <a name="M000320"></a>

        <div class="method-heading">
          <a href="#M000320" class="method-signature">
          <span class="method-name">method_missing</span><span class="method-args">(sym, *args, &amp;block)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Messages that this class does not understand are passed directly to the
@eval_module.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000320-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000320-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/dsl/behaviour.rb, line 143</span>
143:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">method_missing</span>(<span class="ruby-identifier">sym</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
144:         <span class="ruby-ivar">@eval_module</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">sym</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
145:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000326" class="method-detail">
        <a name="M000326"></a>

        <div class="method-heading">
          <a href="#M000326" class="method-signature">
          <span class="method-name">plugin_mock_framework</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000326-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000326-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/dsl/behaviour.rb, line 200</span>
200:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">plugin_mock_framework</span>
201:         <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">mock_framework</span> = <span class="ruby-constant">Spec</span><span class="ruby-operator">::</span><span class="ruby-constant">Runner</span>.<span class="ruby-identifier">configuration</span>.<span class="ruby-identifier">mock_framework</span>
202:         <span class="ruby-keyword kw">when</span> <span class="ruby-constant">Module</span>
203:           <span class="ruby-identifier">include</span> <span class="ruby-identifier">mock_framework</span>
204:         <span class="ruby-keyword kw">else</span>
205:           <span class="ruby-identifier">require</span> <span class="ruby-constant">Spec</span><span class="ruby-operator">::</span><span class="ruby-constant">Runner</span>.<span class="ruby-identifier">configuration</span>.<span class="ruby-identifier">mock_framework</span>
206:           <span class="ruby-identifier">include</span> <span class="ruby-constant">Spec</span><span class="ruby-operator">::</span><span class="ruby-constant">Plugins</span><span class="ruby-operator">::</span><span class="ruby-constant">MockFramework</span>
207:         <span class="ruby-keyword kw">end</span>
208:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000321" class="method-detail">
        <a name="M000321"></a>

        <div class="method-heading">
          <a href="#M000321" class="method-signature">
          <span class="method-name">prepare_execution_context_class</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000321-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000321-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/dsl/behaviour.rb, line 147</span>
147:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">prepare_execution_context_class</span>
148:         <span class="ruby-identifier">plugin_mock_framework</span>
149:         <span class="ruby-identifier">weave_in_included_modules</span>
150:         <span class="ruby-identifier">define_predicate_matchers</span> <span class="ruby-comment cmt">#this is in behaviour_eval</span>
151:         <span class="ruby-identifier">execution_context_class</span>
152:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000325" class="method-detail">
        <a name="M000325"></a>

        <div class="method-heading">
          <a href="#M000325" class="method-signature">
          <span class="method-name">run_after_all</span><span class="method-args">(reporter, dry_run)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000325-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000325-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/dsl/behaviour.rb, line 188</span>
188:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run_after_all</span>(<span class="ruby-identifier">reporter</span>, <span class="ruby-identifier">dry_run</span>)
189:         <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">dry_run</span>
190:           <span class="ruby-keyword kw">begin</span> 
191:             <span class="ruby-ivar">@before_and_after_all_context_instance</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">execution_context</span>(<span class="ruby-keyword kw">nil</span>) 
192:             <span class="ruby-ivar">@before_and_after_all_context_instance</span>.<span class="ruby-identifier">instance_eval</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">after_all_proc</span>(<span class="ruby-identifier">behaviour_type</span>)) 
193:           <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
194:             <span class="ruby-identifier">location</span> = <span class="ruby-value str">&quot;after(:all)&quot;</span>
195:             <span class="ruby-identifier">reporter</span>.<span class="ruby-identifier">example_finished</span>(<span class="ruby-constant">Example</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">location</span>), <span class="ruby-identifier">e</span>, <span class="ruby-identifier">location</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">reporter</span>
196:           <span class="ruby-keyword kw">end</span>
197:         <span class="ruby-keyword kw">end</span>
198:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000324" class="method-detail">
        <a name="M000324"></a>

        <div class="method-heading">
          <a href="#M000324" class="method-signature">
          <span class="method-name">run_before_all</span><span class="method-args">(reporter, dry_run)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000324-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000324-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/dsl/behaviour.rb, line 171</span>
171:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run_before_all</span>(<span class="ruby-identifier">reporter</span>, <span class="ruby-identifier">dry_run</span>)
172:         <span class="ruby-identifier">errors</span> = []
173:         <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">dry_run</span>
174:           <span class="ruby-keyword kw">begin</span>
175:             <span class="ruby-ivar">@before_and_after_all_context_instance</span> = <span class="ruby-identifier">execution_context</span>(<span class="ruby-keyword kw">nil</span>)
176:             <span class="ruby-ivar">@before_and_after_all_context_instance</span>.<span class="ruby-identifier">instance_eval</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">before_all_proc</span>(<span class="ruby-identifier">behaviour_type</span>))
177:           <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
178:             <span class="ruby-identifier">errors</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">e</span>
179:             <span class="ruby-identifier">location</span> = <span class="ruby-value str">&quot;before(:all)&quot;</span>
180:             <span class="ruby-comment cmt"># The easiest is to report this as an example failure. We don't have an Example</span>
181:             <span class="ruby-comment cmt"># at this point, so we'll just create a placeholder. </span>
182:             <span class="ruby-identifier">reporter</span>.<span class="ruby-identifier">example_finished</span>(<span class="ruby-constant">Example</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">location</span>), <span class="ruby-identifier">e</span>, <span class="ruby-identifier">location</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">reporter</span>
183:           <span class="ruby-keyword kw">end</span>
184:         <span class="ruby-keyword kw">end</span>
185:         <span class="ruby-identifier">errors</span>
186:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000322" class="method-detail">
        <a name="M000322"></a>

        <div class="method-heading">
          <a href="#M000322" class="method-signature">
          <span class="method-name">weave_in_included_modules</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000322-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000322-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/dsl/behaviour.rb, line 154</span>
154:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">weave_in_included_modules</span>
155:         <span class="ruby-identifier">mods</span> = [<span class="ruby-ivar">@eval_module</span>]
156:         <span class="ruby-identifier">mods</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">included_modules</span>.<span class="ruby-identifier">dup</span>
157:         <span class="ruby-identifier">mods</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">Spec</span><span class="ruby-operator">::</span><span class="ruby-constant">Runner</span>.<span class="ruby-identifier">configuration</span>.<span class="ruby-identifier">modules_for</span>(<span class="ruby-identifier">behaviour_type</span>)
158:         <span class="ruby-identifier">execution_context_class</span>.<span class="ruby-identifier">class_eval</span> <span class="ruby-keyword kw">do</span>
159:           <span class="ruby-comment cmt"># WARNING - the following can be executed in the context of any</span>
160:           <span class="ruby-comment cmt"># class, and should never pass more than one module to include</span>
161:           <span class="ruby-comment cmt"># even though we redefine include in this class. This is NOT</span>
162:           <span class="ruby-comment cmt"># tested anywhere, hence this comment.</span>
163:           <span class="ruby-identifier">mods</span>.<span class="ruby-identifier">flatten</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">mod</span><span class="ruby-operator">|</span> <span class="ruby-identifier">include</span> <span class="ruby-identifier">mod</span>}
164:         <span class="ruby-keyword kw">end</span>
165:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>